package com.zlzxm.shoesmarket.net.repository;

import com.zlzxm.shoesmarket.net.RetrofitClient;
import com.zlzxm.shoesmarket.net.api.UserApi;
import com.zlzxm.shoesmarket.net.request.RqLogin;
import com.zlzxm.shoesmarket.net.request.RqRegister;
import com.zlzxm.shoesmarket.net.respone.BaseResponse;
import com.zlzxm.shoesmarket.net.respone.RpLogin;
import com.zlzxm.shoesmarket.net.respone.RpVip;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;

/**
 * CREATE BY zlzxm ON 5/11/21
 */
public class UserRepository {

    UserApi userApi = RetrofitClient.create(UserApi.class);

    /**
     * 获取vip 套餐
     * @return 返回值
     */
    public Observable<BaseResponse<List<RpVip>>> vipList(){

        return userApi.vipList();
    }

    public Observable<BaseResponse<String>> vipDesc(){

        return userApi.vipDesc();
    }

    public  Observable<BaseResponse<String>> register( RqRegister rqRegister){

        return userApi.register(rqRegister);
    }

    public Observable<BaseResponse<RpLogin>> login(RqLogin rqLogin){

        return userApi.login(rqLogin);
    }

}
